﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ManageStore.IViews
{
    public interface IBaseView
    {
        event MethodInvoke EvtNew;
        event MethodInvoke EvtEdit;
        event MethodInvoke EvtDelete;
        event MethodInvoke EvtSave;
        event MethodInvoke EvtClose;

        bool BeforeHandler(string pEventName, params object[] pParams);
        bool ErrorHandler(string pEventName, params object[] pParams);
        bool CompletedHandler(string pEventName, params object[] pParams);
        bool ValidationHandler(string pColumnName, params object[] pParams);
    }
    public delegate bool MethodInvoke(params object[] pParams);
    public delegate bool ActionInvoke(Action<object> pAction, params object[] pParams);
    public delegate bool FunctionInvoke(Func<object> pFunc, params object[] pParams);

    public class ViewEventAgr
    {
        public delegate bool ActionInvoke(params object[] pParams);
        public ActionInvoke BeforeEvent { get; set; }
        public ActionInvoke ErrorEvent { get; set; }
        public ActionInvoke CompletedEvent { get; set; }
    }


}
